\usepackage[textwidth=1.5in]{todonotes}
\usepackage{clrscode3e}
\usepackage{hyperref}
\usepackage{comment}
\usepackage{appendix}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Structure
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Don't put chapter number in section numbers
% \renewcommand*\thesection{\arabic{section}}	% commented out to include chapter number in section numbers

\newcommand{\anchorednote}[2]{ #1 \note{#2} }	% anchored note - needed for latex2edx
\newcommand{\note}[1]{\todo[color=blue!10,
    linecolor=blue!90,size=\small]{\linespread{0.9}\selectfont{#1}\par}}
\newcommand\lpknote[1]{\todo[color=orange!10, linecolor=orange!90,
    size=\footnotesize]{\linespread{0.9}\selectfont{{\bf LPK!!} #1}\par}}

\usepackage{tcolorbox}
\newtcolorbox{examplebox}{colback=green!5!white}
\newtcolorbox{noticebox}{colback=red!5!white}

% \scalebox{1.5}{\begin{tikzpicture}
%   % Put your tikz code here
% \end{tikzpicture}}

\newcommand\question[1]{\vskip0.05in\todo[inline, color=yellow!5]{{\bf
        Study Question:}  #1}}

\def\myrightmargin{2.0in}
% Make it compact for printing
%\renewcommand{\note}[1]{\footnote{#1}}
%\def\myrightmargin{1.0in}
\usepackage[left=1in, top=1in, bottom=1in,right=\myrightmargin]{geometry}
\usepackage{fancyhdr}
\usepackage[mmddyy,hhmmss]{datetime}
\pagestyle{fancy}
\lhead{\em MIT 6.390}
\chead{\em Fall 2024}
\rhead{\em \thepage}
\rfoot{\em Last Updated: \today\ \currenttime}
\cfoot{}

\usepackage[Sonny]{fncychap}

\usepackage{listings}
% Provide compact itemize, etc.
\usepackage{paralist}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\usepackage[shortlabels]{enumitem}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath}
\usepackage{amsfonts}
\renewcommand{\rmdefault}{ppl} % rm is palatino
\linespread{1.05}        % Palatino needs more leading
\usepackage[scaled]{helvet} % ss
%\usepackage[scaled=1.03]{inconsolata}
\usepackage{courier} % Alternative to inconsolata
\usepackage{eulervm}
\normalfont
\usepackage[T1]{fontenc}
% bold symbols math mode
\usepackage{bm}
% blackboard bold
\usepackage{bbold}
% Dangerous bend!  /dbend
%\usepackage{manfnt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Math macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Use to index over examples
\newcommand\ex[2]{#1^{(#2)}}
% Data sets
\newcommand\data{{\cal D}}
\newcommand\dataTrain{{\cal D}_n}
\newcommand\dataTest{{\cal D}_{n'}}
% Model, hypoth
\newcommand\model{{\cal M}}
\newcommand\hclass{{\cal H}}
% Max likelihood
\newcommand\ml[1]{#1_{\bf ml}}
% Empirical risk min
\newcommand\erm[1]{#1_{\bf erm}}
% Arg max
\newcommand\argmax[1]{{\rm arg}\max_{#1}}
\newcommand\argmin[1]{{\rm arg}\min_{#1}}
% Math
\newcommand{\R}{\mathbb{R}}
% errors
\newcommand{\trainerr}{\mathcal{E}_n}
\newcommand{\testerr}{\mathcal{E}}
\newcommand{\trainerrreg}{\text{MSE}_\text{train}}
\newcommand{\testerrreg}{\text{MSE}_\text{test}}
% sign
\newcommand{\sign}{\text{sign}}
% 2d vec
\newcommand*{\twodrow}[2]{\begin{bmatrix} #1 & #2 \end{bmatrix}}
\newcommand*{\twodcol}[2]{\begin{bmatrix} #1 \\ #2 \end{bmatrix}}
% norm
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
% alg
\newcommand{\alg}{\mathcal{A}}
% loss
\newcommand{\loss}{\mathcal{L}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Math packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Thm styles
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]

\usepackage{mathtools}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Diagrams
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\usepackage{xcolor}
\usepackage{tikz}
\usepackage{expl3}
\usepackage{caption}
\usepackage{float}
\ExplSyntaxOn
\int_zero_new:N \g__prg_map_int
\ExplSyntaxOff
\usepackage{pgfplots}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing,calligraphy}
\usetikzlibrary{arrows}
\usetikzlibrary{plotmarks}
\usetikzlibrary{automata, positioning}

% plus and minus macros
\tikzset{
  pluscs/.pic={
      \draw[ultra thick, blue] +(axis cs: -.2,0) -- +(axis cs: .2,0);
      \draw[ultra thick, blue] +(axis cs: 0,-.2) -- +(axis cs: 0,.2);
    },
  plus/.pic={
      \draw[ultra thick, blue] +(-.2,0) -- +(.2,0);
      \draw[ultra thick, blue] +(0,-.2) -- +(0,.2);
    },
  minus/.pic={
      \draw[ultra thick, red] +(-.2,0) -- +(.2,0);
    },
  plusblk/.pic={
      \draw[ultra thick] +(-.2,0) -- +(.2,0);
      \draw[ultra thick] +(0,-.2) -- +(0,.2);
    },
  minusblk/.pic={
      \draw[ultra thick] +(-.2,0) -- +(.2,0);
    },
}

% https://tex.stackexchange.com/questions/203821/draw-round-rectangular-bracket-embracing-nodes-in-tikz
\tikzset{
  ncbar angle/.initial=90,
  ncbar/.style={
      to path=(\tikztostart)
      -- ($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)
      -- ($(\tikztotarget)!($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztostart)$)
      -- (\tikztotarget)
    },
  ncbar/.default=0.5cm,
}

\tikzset{square left brace/.style={ncbar=0.3cm}}
\tikzset{square right brace/.style={ncbar=-0.3cm}}

% other helpful definitions

\def\Xt{\tilde{X}}
\def\Yt{\tilde{Y}}


\newcounter{col}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Index and Glossary
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{imakeidx}
\makeindex[columns=1, title=Index, intoc]
\usepackage[toc,nonumberlist]{glossaries}
\makeglossaries
\input{glossary.tex}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "top"
%%% End:
